package com.dxd.onlineshop.service.impl;

import com.dxd.onlineshop.pojo.Categories;
import com.dxd.onlineshop.pojo.Product;
import com.dxd.onlineshop.service.CategoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dxd.onlineshop.mapper.goodsMapper;

import java.util.List;

@Service
public class CategoriesServiceImpl implements CategoriesService {

    private final goodsMapper goodsMapper;

    @Autowired
    public CategoriesServiceImpl(goodsMapper goodsMapper) {
        this.goodsMapper = goodsMapper;
    }

    //获取所有商品分类
    @Override
    public List<Categories> getCategories() {
        return goodsMapper.getCategories();
    }

    //获取所有商品
    @Override
    public List<Product> getProducts(){
        return goodsMapper.getProducts();
    }
}